<%= form_for @changeset, @action, fn f -> %>
<%= if @changeset.action do %>
  <div class="alert alert-danger">
    <p>Oops, something went wrong! Please check the errors below.</p>
  </div>
<% end %>
<h5 id="rules-header">Name</h5>
<div class="form-group">
  <%= text_input f, :name %>
  <small class="form-text text-muted">
    Name of the application.
  </small>
  <%= error_tag f, :name %>
</div>
<h5 id="rules-header">Redirect URI</h5>
<div class="form-group">
  <%= textarea f, :redirect_uri %>
  <small class="form-text text-muted">
    Use one line per URI.
  </small>
  <small class="form-text text-muted">
    Use <code><%= ExOauth2Provider.Config.native_redirect_uri() %></code> for local tests.
  </small>
  <%= error_tag f, :redirect_uri %>
</div>
<h5 id="rules-header">Scopes</h5>
<div class="form-group">
  <%= text_input f, :scopes %>
  <small class="form-text text-muted">
    Separate scopes with spaces. Leave blank to use the default scopes.
  </small>
  <%= error_tag f, :scopes %>
</div>
<h5 id="rules-header">Secret</h5>
<div class="form-group">
  <%= text_input f, :secret %>
  <small class="form-text text-muted">
    Leave blank if using with Cloudflare.
  </small>
  <%= error_tag f, :secret %>
</div>
<div>
  <%= submit "Submit", class: "btn btn-primary"  %>
</div>
<% end %>
